﻿<%@ Page Title="" Language="C#" MasterPageFile="~/List.Master" AutoEventWireup="true" CodeBehind="RoleList.aspx.cs" Inherits="SGDemo.Permission.RoleList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cpHeader" runat="server"> 
    <script src="RoleList.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpBody" runat="server">
    <div class="ui-menu">
        <uc:Menu ID="menu1" runat="server" DataFile="../Views/Permission/Menu/RoleList.xml"
            PageCode="RoleList" />
    </div>
    <div class="ui-wrapper">
        <div id="listall" class="ui-content-item ui-content-item-selected">
            <%--gvwList--%>
            <dx:ASPxGridView ID="gvwList" ClientInstanceName="gvwList" runat="server" AutoGenerateColumns="False"
                DataSourceID="odsList" Width="100%" KeyFieldName="Keyid" 
                OnCustomCallback="gvwList_CustomCallback">
                <Columns>
                    <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" HeaderStyle-HorizontalAlign="Center" Width="40">
                        <HeaderTemplate>
                            <dx:ASPxCheckBox ID="cbSelectAll" runat="server">
                                <ClientSideEvents CheckedChanged="doSelectOrUnselectAll" />
                            </dx:ASPxCheckBox>
                        </HeaderTemplate>
                    </dx:GridViewCommandColumn>
                    <dx:GridViewDataColumn Caption="岗位名称" FieldName="RoleName" VisibleIndex="1" Width="120">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="岗位编码" FieldName="RoleCode" VisibleIndex="2" Width="80">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="岗位助记码" FieldName="HelpCode" VisibleIndex="3" Width="80">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="岗位英文名称" FieldName="RoleNameEn" VisibleIndex="4" Width="120">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="岗位级别" FieldName="Grade" VisibleIndex="4" CellStyle-HorizontalAlign="Left" Width="70">
                    </dx:GridViewDataColumn>
                    <dx:GridViewDataColumn Caption="所有的模块" FieldName="Remark" VisibleIndex="8"> 
                        <DataItemTemplate>
                            <%#Eval("Remark").ToString().Length > 30 ? Eval("Remark").ToString().Substring(0, 30) + "..." : Eval("Remark")%>
                        </DataItemTemplate>
                    </dx:GridViewDataColumn>
                </Columns>
                <ClientSideEvents SelectionChanged="doSelectionChanged" RowDblClick="doRowDblClick" />
                <SettingsBehavior AllowFocusedRow="true" AllowGroup="true" AutoExpandAllGroups="true"/>
                <SettingsLoadingPanel Text="加载中..." />
                <SettingsPager Mode="ShowAllRecords">
                </SettingsPager>
                <SettingsText EmptyDataRow="没有数据显示" />
                <Styles>
                 <GroupPanel ></GroupPanel>
                <AlternatingRow Enabled="True"/>
                </Styles>
            </dx:ASPxGridView>
            <%--数据源控件--%>
            <asp:ObjectDataSource ID="odsList" runat="server" TypeName="SGDemo.Permission.RoleDataSource"
                SelectMethod="FilteredGetAll">
                <SelectParameters>
                    <asp:ControlParameter Name="filterConditions" Type="String" ControlID="hfFilterCondition"
                        PropertyName="Value" ConvertEmptyStringToNull="false" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <%--存储过滤条件--%>
            <asp:HiddenField ID="hfFilterCondition" ClientIDMode="Static" runat="server" Value=" " />
             <%--GridView数据导出--%>
            <dx:ASPxGridViewExporter ID="gvweList" GridViewID="gvwList" runat="server"
                FileName="角色列表">
            </dx:ASPxGridViewExporter>
        </div>
        <div id="search" class="ui-content-item">
            <ul class="ui-list">
                <li>
                    <dx:ASPxLabel ID="lblRoleName" runat="server" Text="岗位名称：" AssociatedControlID="txtRoleName" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtRoleName" ClientInstanceName="txtRoleName" runat="server"
                        Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="lblRoleCode" runat="server" Text="岗位编码：" AssociatedControlID="txtRoleCode" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtRoleCode" ClientInstanceName="txtRoleCode" runat="server"
                        Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="lblHelpCode" runat="server" Text="助记码：" AssociatedControlID="txtHelpCode" />
                </li>
                <li>
                    <dx:ASPxTextBox ID="txtHelpCode" ClientInstanceName="txtHelpCode" runat="server"
                        Width="120px">
                    </dx:ASPxTextBox>
                </li>
                <li>
                    <dx:ASPxLabel ID="lblGrade" runat="server" Text="岗位等级：" AssociatedControlID="cbGrade" />
                </li>
                <li>
                    <dx:ASPxComboBox ID="cbGrade" ClientInstanceName="cbGrade" runat="server" Width="120">
                        <Items>
                            <dx:ListEditItem Text="一级" Value="1" />
                            <dx:ListEditItem Text="二级" Value="2" />
                            <dx:ListEditItem Text="三级" Value="3" />
                        </Items>
                    </dx:ASPxComboBox>
                </li>
            </ul>
            <ul class="sl-floatcenter clearfix">
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="btnSubmit" ClientInstanceName="btnSubmit" runat="server" Text="查 询"
                        AutoPostBack="false">
                        <ClientSideEvents Click="doSubmittedToSearch" />
                    </dx:ASPxButton>
                </li>
                <li class="sl-floatcenter-item">
                    <dx:ASPxButton ID="btnReset" ClientInstanceName="btnReset" runat="server" Text="重 置"
                        AutoPostBack="false">
                        <ClientSideEvents Click="doResetToSearch" />
                    </dx:ASPxButton>
                </li>
            </ul>
        </div>
        <%--导出数据--%>
        <dx:ASPxPopupControl ID="pcExport" ClientInstanceName="pcExport" runat="server" CloseAction="CloseButton"
            LoadContentViaCallback="OnFirstShow" PopupVerticalAlign="WindowCenter" PopupHorizontalAlign="WindowCenter"
            AllowDragging="True" Width="320" Height="200" Modal="true" LoadingPanelText="加载中..."
            HeaderText="导出数据" EnableViewState="False">
            <ContentCollection>
                <dx:PopupControlContentControl ID="pcExportContent" runat="server">
                    <div id="exportDialog">
                        <ul class="ui-list-vertical">
                            <li>
                                <dx:ASPxButton ID="btnExportXls" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Xls" Text="Xls文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                            <li>
                                <dx:ASPxButton ID="btnExportXlsx" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Xlsx" Text="Xlsx文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                            <li>
                                <dx:ASPxButton ID="btnExportPdf" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Pdf" Text="Pdf文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                            <li>
                                <dx:ASPxButton ID="btnExportRtf" runat="server" OnClick="btnExporter_Click" AutoPostBack="False"
                                    UseSubmitBehavior="false" CommandName="Rtf" Text="Rtf文件导出" Width="120" CssClass="ui-btn">
                                </dx:ASPxButton>
                            </li>
                        </ul>
                        <ul class="sl-floatcenter clearfix">
                            <li class="sl-floatcenter-item">
                                <dx:ASPxButton ID="btnCloseToExport" ClientInstanceName="btnCloseToExport" runat="server"
                                    AutoPostBack="False" Text="关 闭">
                                    <ClientSideEvents Click="doCloseToExport" />
                                </dx:ASPxButton>
                            </li>
                        </ul>
                    </div>
                </dx:PopupControlContentControl>
            </ContentCollection>
        </dx:ASPxPopupControl>
    </div>
</asp:Content>
